package com.camelot.boot.module.system.dal.mysql.companyrequirement;

import java.util.*;

import com.camelot.boot.framework.common.pojo.PageResult;
import com.camelot.boot.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.camelot.boot.framework.mybatis.core.mapper.BaseMapperX;
import com.camelot.boot.module.system.dal.dataobject.companyrequirement.CompanyRequirementDO;
import org.apache.ibatis.annotations.Mapper;
import com.camelot.boot.module.system.controller.admin.companyrequirement.vo.*;

/**
 * 用户公司需求配置信息 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface CompanyRequirementMapper extends BaseMapperX<CompanyRequirementDO> {

    default PageResult<CompanyRequirementDO> selectPage(CompanyRequirementPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CompanyRequirementDO>()
                .likeIfPresent(CompanyRequirementDO::getName, reqVO.getName())
                .eqIfPresent(CompanyRequirementDO::getUserId, reqVO.getUserId())
                .eqIfPresent(CompanyRequirementDO::getFocus, reqVO.getFocus())
                .eqIfPresent(CompanyRequirementDO::getDescription, reqVO.getDescription())
                .eqIfPresent(CompanyRequirementDO::getCompanyId, reqVO.getCompanyId())
                .eqIfPresent(CompanyRequirementDO::getType, reqVO.getType())
                .eqIfPresent(CompanyRequirementDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(CompanyRequirementDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(CompanyRequirementDO::getId));
    }

}